package com.cqgc.service.impl;

import com.cqgc.dao.UserDao;
import com.cqgc.domain.NewPassword;
import com.cqgc.domain.PageHelper;
import com.cqgc.domain.User;
import com.cqgc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao dao;
    @Override
    public User login(User user) {
        return dao.Login(user);
    }

    @Override
    public int UpdateTime(User user) {
        return dao.UpdateTime(user);
    }

    @Override
    public int addUser(User user) {
        return dao.addUser(user);
    }

    @Override
    public List<User> findAll(PageHelper pageHelper) {
        return dao.findAll(pageHelper);
    }

    @Override
    public List<User> findAllUser() {
        return dao.findAllUser();
    }

    @Override
    public int editUser(User user) {
        return dao.editUser(user);
    }

    @Override
    public User findUserByUid(int uid) {
        return dao.findUserByUid(uid);
    }

    @Override
    public int editPassword(NewPassword newPassword) {
        return dao.editPassword(newPassword);
    }

    @Override
    public int delUser(User user) {
        return dao.delUser(user);
    }

    @Override
    public int deleteUser(User user) {
        return dao.deleteUser(user);
    }
}
